package cn.szq.springframework.test.common;

import cn.szq.springframework.beans.BeansException;
import cn.szq.springframework.beans.PropertyValue;
import cn.szq.springframework.beans.PropertyValues;
import cn.szq.springframework.beans.factory.ConfigurableListableBeanFactory;
import cn.szq.springframework.beans.factory.config.BeanDefinition;
import cn.szq.springframework.beans.factory.config.BeanFactoryPostProcessor;

/***
 * All rights Reserved, Designed By www.jx-lab.com
 * @Title: MyBeanFactoryPostProcessor
 * @Description:
 * @author lixy
 * @date 2021/8/16 15:09
 * @version V1.0
 * @Copyright: www.jx-lab.com Inc. All rights reserved.
 * 注意：本内容仅限于众合景轩信息技术有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {


    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();

        propertyValues.addPropertyValue(new PropertyValue("company", "改为：字节跳动"));
    }
}
